﻿ <%@ Page Title="" Language="C#" MasterPageFile="~/PageTemplate.Master" AutoEventWireup="true" CodeBehind="Retreats.aspx.cs" Inherits="RMS.Pages.Admin.Retreats" 
     MaintainScrollPositionOnPostBack="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContent" runat="server">
      
    <!-- Retreats web form allows admin users to edit / delete Retreats. -->
    <h1>Edit, Remove, or View Retreats</h1>
    <hr />
    <br />
    <table>
        <tr>
            <td style="vertical-align: middle;">
                <span class="bluetext">Search By: </span> 
            </td>
            <td style="vertical-align: middle;">
                <select id="cbCatSelect" runat="server">
                    <option value="All Categories">All Categories</option>
                    <option value="Day and Evening Programs">Day and Evening Programs</option>
                    <option value="Directed Retreats">Directed Retreats</option>
                    <option value="Healing and Transformation">Healing and Transformation</option>
                    <option value="Preached Retreats">Preached Retreats</option>
                    <option value="Religious Life">Religious Life</option>
                    <option value="Special Themes">Special Themes</option>
               </select>
            </td>
            <td style="vertical-align: middle;">
                &nbsp;&nbsp;
                <asp:Button ID="btnSearch" CssClass="myButton" runat="server" Text="Search" OnClick="btnSearch_Click" />
            </td>
        </tr>
    </table>
    <hr />
        
    <!-- Edit / Delete Retreat ListView -->
    <asp:ListView ID="ListView1" ItemType="RMS.Models.Retreat" SelectMethod="GetRetreats"
        DataKeyNames="Ret_ID" UpdateMethod="UpdateRetreat"
        DeleteMethod="DeleteRetreat" InsertMethod="InsertRetreat"
        InsertItemPosition="LastItem" OnItemCommand="ViewReservation"
        EnableViewState="false" runat="server" >

        <LayoutTemplate>
             
            <table class="editTable" runat="server" id="itemPlaceholder"> 
                
           </table>

        </LayoutTemplate>

        <ItemTemplate>
            <table class="editTable">
                <tr>
                    <td>Title:</td>
                    <td><b><%# Item.Ret_Title %></b></td>
                </tr>
                <tr>
                    <td>Presenters:</td>
                    <td><%# Item.Ret_Presenters %></td>
                </tr>
                 <tr>
                    <td>Cost:</td>
                    <td><%# Item.Ret_Cost.ToString("c") %></td>
                </tr>
                <tr>
                    <td>Time:</td>
                    <td><%# Item.Ret_Checkin %></td>
                </tr>
                <tr>
                    <td>Main Category:</td>
                    <td><%# Item.Ret_Main_Category %></td>
                </tr>
                <tr>
                    <td>Category #2:</td>
                    <td><%# Item.Ret_Category_Two %></td>
                </tr>

                <tr>
                    <td>Category #3:</td>
                    <td><%# Item.Ret_Category_Three %></td>
                </tr>
                <tr>
                    <td>Category #4:</td>
                    <td><%# Item.Ret_Category_Four %></td>
                </tr>
                 <tr>
                    <td>About:</td>
                    <td><%# Item.Ret_About %></td>
                    
                 </tr>
                <tr>
                    <td>Dates:</td>
                    <td><%# Item.Ret_Dates %></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td> 
                        <asp:Button CssClass="myButton" ID="Button1" CommandName="Edit" Text="Edit" runat="server" />
                        <asp:Button CssClass="myButton" ID="Button2" CommandName="Delete" Text="Remove" OnClientClick="return confirm('Are you sure you want to remove this retreat?');" runat="server" />
                        <asp:Button CssClass="myButton" ID="Button3" CommandName="ViewReservation"  Text="View Reservations" runat="server" />
                    </td>
                </tr>
                   
            </table>
            <hr />            
                    
        </ItemTemplate>

        <EditItemTemplate>
            <table class="editTable">
                <tr>
                    <td>Title:</td>
                    <td>
                        <input class="txtbxcomp" name="Ret_Title" value="<%# Item.Ret_Title %>" />
                        <input type="hidden" name="Ret_ID" value="<%# Item.Ret_ID %>" />
                    </td>
                </tr>
                <tr>
                    <td>Presenters:</td>
                    <td><input class="txtbxcomp lettersOnly" name="Ret_Presenters" value="<%# Item.Ret_Presenters %>" /></td>
                </tr>
                 <tr>
                    <td>Cost:</td>
                    <td><input class="txtbxcomp numbersOnly" name="Ret_Cost" value="<%# Item.Ret_Cost %>" /></td>
                </tr>
                <tr>
                    <td>Time:</td>
                    <td><input class="txtbxcomp" name="Ret_Checkin" value="<%# Item.Ret_Checkin %>" /></td>
                </tr>
                <tr>
                    <td>Main Category:</td>
                    <td>
                        <select class="largetxtbxcomp" name="Ret_Main_Category" >
                            <option selected="selected"><%# Item.Ret_Main_Category %></option>
                            <option value="Day and Evening Programs">Day and Evening Programs</option>
                            <option value="Directed Retreats">Directed Retreats</option>
                            <option value="Healing and Transformation">Healing and Transformation</option>
                            <option value="Preached Retreats">Preached Retreats</option>
                            <option value="Religious Life">Religious Life</option>
                            <option value="Special Themes">Special Themes</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Category #2:</td>
                    <td>
                        <select class="largetxtbxcomp" name="Ret_Category_Two" >
                            <option selected="selected"><%# Item.Ret_Category_Two %></option>
                            <option value=""></option>
                            <option value="Day and Evening Programs">Day and Evening Programs</option>
                            <option value="Directed Retreats">Directed Retreats</option>
                            <option value="Healing and Transformation">Healing and Transformation</option>
                            <option value="Preached Retreats">Preached Retreats</option>
                            <option value="Religious Life">Religious Life</option>
                            <option value="Special Themes">Special Themes</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td>Category #3:</td>
                    <td>
                        <select class="largetxtbxcomp" name="Ret_Category_Three" >
                            <option selected="selected"><%# Item.Ret_Category_Three %></option>
                            <option value=""></option>
                            <option value="Day and Evening Programs">Day and Evening Programs</option>
                            <option value="Directed Retreats">Directed Retreats</option>
                            <option value="Healing and Transformation">Healing and Transformation</option>
                            <option value="Preached Retreats">Preached Retreats</option>
                            <option value="Religious Life">Religious Life</option>
                            <option value="Special Themes">Special Themes</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Category #4:</td>
                    <td>
                        <select class="largetxtbxcomp" name="Ret_Category_Four" >
                            <option selected="selected"><%# Item.Ret_Category_Four %></option>
                            <option value=""></option>
                            <option value="Day and Evening Programs">Day and Evening Programs</option>
                            <option value="Directed Retreats">Directed Retreats</option>
                            <option value="Healing and Transformation">Healing and Transformation</option>
                            <option value="Preached Retreats">Preached Retreats</option>
                            <option value="Religious Life">Religious Life</option>
                            <option value="Special Themes">Special Themes</option>
                        </select>
                    </td>
                </tr>
                 <tr>
                    <td>About:</td>
                    <td><textarea class="largetxtbxcomp" rows="12" cols="64" name="Ret_About"><%# Item.Ret_About %></textarea></td>
                 </tr>
                <tr>
                    <td>Date:</td>
                    <td><textarea class="largetxtbxcomp" rows="4" cols="64" name="Ret_Dates"><%# Item.Ret_Dates %></textarea></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td> 
                        <asp:Button CssClass="myButton" ID="Button3" CommandName="Update" Text="Update" runat="server"/>
                        <asp:Button CssClass="myButton" ID="Button4" CommandName="Cancel" Text="Cancel" runat="server"/>
                    </td>
                </tr>
                   
            </table>
            <hr />           
            
        </EditItemTemplate>
             
        <InsertItemTemplate> </InsertItemTemplate>
        
    </asp:ListView>
   
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
    <span><a href="/pages/UserAccount.aspx">View Admin Account</a></span>
    <span><a class="selected" href="/admin/retreats">Edit, Remove, or View Retreats</a></span>
    <span><a href="/admin/addretreat">Add Retreats</a></span>
    <span><a href="/admin/reports">Generate Reports</a></span>
    <span><a href="/pages/admin/Users.aspx">Edit, Remove, or View Users</a></span>
    <span><a href="/pages/CreateAccount.aspx">Add Users</a></span>
</asp:Content>
